<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script>
    //var arr = new Array(2); //里面2表示里面有两个空数组
    var arr = new Array(2,3);
    var arr1 = [];
    var obj = {};
    console.log(obj instanceof Array);
    console.log(Array.isArray(arr1));
    var arr2 = [1,2,3];
    arr2.push(4,'777');
    console.log(arr2);
    var arr3 = [1,2,3];
    arr3.unshift(5);
    console.log(arr3);
    var arr4 = [1,2,3];
    arr4.pop();
    console.log(arr4);
    var arr5 = [1,2,3];
    arr5.shift();
    console.log(arr5);
    var arr6 = [1,2,3];
    arr6.reverse();
    console.log(arr6);
    var arr7 = [15,85,2,7,2];
    arr7.sort(function (a, b) {
        //return a - b; //升序
        return b - a;   //降序
    });
    console.log(arr7);
    console.log(arr7.indexOf(85));
    console.log(arr7.lastIndexOf(2));
    console.log(arr7.toString());
    console.log(arr7.join('-'))
</script>
<body>

</body>
</html>